<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Ajax post请求</title>
	</head>
	<body>
		<h1>Axios远程调用练习</h1>
		<script src="../js/axios.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			/*1.post请求说明*/
			let user={
				name: '建党百年',
				age: 100,
				sex: '未知'
				}
				//post请求的参数
			axios.post("http://localhost:8090/saveUser",user)
				.then(result=>{
					console.log(result.data)
				})
				
			/*利用restful风格实现用户新增 
			*/	
		   axios.post("http://localhost:8090/user/好生活/100/不男不女")
		   .then(result=>{
			   console.log(result.data)
		   })
		   
		   /*PUT 修改操作 传递对象使用最为频繁*/
		   // axios.put("url","修改的对象")
		   // .then(result=>{
			  //  console.log(result.data)
			  //  })
		</script>
	</body>
</html>
